import java.util.Date;

import javax.swing.JFrame;
import javax.swing.UIManager;

import nauja.utils.jcalendar.JCalendar;

/**
 * Example on how to create the calendar with current date.
 * @author Jeremy Morosi
 * @version 1.0
 */
public class ExampleCurrentDate {


	//***********************************************
	//              MAIN
	//***********************************************

	/**
	 * Main function.
	 * @param args arguments.
	 */
	public static void main(String[] args) {
		setLookAndFeel();
		JFrame frame = new JFrame();
		frame.setTitle("Current date");
		// Create the calendar.
		Date date = new Date();
		frame.setContentPane(JCalendar.getInstance(date));
		// End.
		frame.pack();
		frame.setLocationRelativeTo(null);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
	

	//***********************************************
	//              GLOBAL FUNCTIONS
	//***********************************************

	/**
	 * Modify look and feel.
	 */
	public static void setLookAndFeel() {
		try {
			UIManager.setLookAndFeel(
				UIManager.getSystemLookAndFeelClassName());
		} catch(Exception e) {}
	}
	
}